<%extends file='base.tpl'%>
<%block name='aside'%>
<ul class="side-nav">
	<li>
		<h2>功能一</h2>
		<ul>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
		</ul>
	</li>
	<li>
		<h2>功能一</h2>
		<ul>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
		</ul>
	</li>
	<li>
		<h2>功能一</h2>
		<ul>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
		</ul>
	</li>
	<li>
		<h2>功能一</h2>
		<ul>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
			<li>二级功能</li>
		</ul>
	</li>
</ul>
<%/block%>
<%block name='article'%>
	<table class="table1">
	    <thead>
		    <tr>
    			<th>表头1</th>
    			<th>表头1</th>
    			<th>表头1</th>
    			<th>表头1</th>
    			<th>表头1</th>
    		</tr>
		</thead>
		<tfoot>
		    <tr>
		        <td colspan="5"><div class="page"><a href="#1">1</a> <a href="#2">2</a></div></td>
		    </tr>
		</tfoot>
		<tbody id="tbody1">
		<%foreach $table1 as $item%>
			<tr class="<%cycle values=',alt'%>">
			<%foreach $item as $i%>
				<td><%$i%></td>
			<%/foreach%>
			</tr>
		<%/foreach%>
		</tbody>
	</table>
<%/block%>
<%block name="ft_js"%>
<script>
var ft_js = null;
Dom.ready(function(){
    alert('dom ready');
    W('.side-nav h2').on('click',function(e){
        console.log(W(this));
        alert(this);
    });
    W('.page>a').on('click',function(e){
       e.preventDefault(); 
       var pn = W(this).attr('href').replace('#');
       var arr = [
           {a:'fewa',b:'ewaf',c:'c',d:'d',e:'e'},
           {a:'fewa',b:'ewaf',c:'c',d:'d',e:'e'},
           {a:'fewa',b:'ewaf',c:'c',d:'d',e:'e'},
           {a:'fewa',b:'ewaf',c:'c',d:'d',e:'e'},
           {a:'fewa',b:'ewaf',c:'c',d:'d',e:'e'}
       ];
       var len = arr.length;
       var html = [];
       var tpl_tb = "<tr class='{$alt}'><td>{$a}</td><td>{$b}</td><td>{$c}</td><td>{$d}</td><td>{$e}</td></tr>";
       for(var i=0;i<len;i++){
           if(i%2 !== 0){
               arr[i].alt = 'alt';
           }else{
               arr[i].alt = '';
           }
           html.push(tpl_tb.tmpl(arr[i]));
       }
       //console.log(html.join(''));
       W('#tbody1').html(html.join(''));
    });
});
</script>
<%/block%>